//
//  AlbumCollectionViewCell.m
//  MIXMT
//
//  Created by 方希罕 on 16/5/19.
//  Copyright © 2016年 FGL. All rights reserved.
//

#import "AlbumCollectionViewCell.h"

@interface AlbumCollectionViewCell ()
@property (nonatomic , strong)UIImageView *typeImageView;;

@end

@implementation AlbumCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {

    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}


- (void)createView {

    self.picImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    [self.contentView addSubview:_picImageView];
    self.typeImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 50, 50)];

    [self.contentView addSubview: self.typeImageView];

}

- (void)layoutSubviews{
    if (self.isSelected) {
        self.typeImageView.image = [UIImage imageNamed:@"image-selected"]; 
    }
    else{
        self.typeImageView.image = [UIImage imageNamed:@"image-deselected"];
    }
    _picImageView.frame = CGRectMake(0, 0, self.frame.size.width,self.frame.size.height);
    _typeImageView.frame = CGRectMake(self.frame.size.width - 21, 0, 21, 21);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
